package wang.chunfan.springcloud.learning.feign.server.feign.fallback;

import org.springframework.stereotype.Component;
import wang.chunfan.springcloud.learning.feign.server.feign.UserFeign;
import wang.chunfan.springcloud.learning.feign.server.model.Result;
import wang.chunfan.springcloud.learning.feign.server.model.User;

import java.util.List;

/**
 * @version 1.0
 * @Author wangchunfan
 * @Date 2020/5/23 21:17
 **/
@Component
public class UserFeignFallback implements UserFeign {
    @Override
    public Result insert(User user) {
        return new Result("调用失败，服务被降级", 500);
    }

    @Override
    public Result delete(Long id) {
        return new Result("调用失败，服务被降级", 500);
    }

    @Override
    public Result update(User user) {
        return new Result("调用失败，服务被降级", 500);

    }

    @Override
    public Result<User> get(Long id) {
        return new Result("调用失败，服务被降级", 500);
    }

    @Override
    public Result<List<User>> list(List<Long> ids) {
        return new Result("调用失败，服务被降级", 500);
    }

    @Override
    public Result<List<User>> getByUsername(String username) {
        return new Result("调用失败，服务被降级", 500);
    }
}
